﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.ProvinceCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.ProvinceHandler
{
    public class ProvinceCommandHandlers : IRequestHandler<ProvinceCommand, List<Province>>
    {
        IProvinceService pSer;

        public ProvinceCommandHandlers(IProvinceService pSer)
        {
            this.pSer = pSer;
        }
        public async Task<List<Province>> Handle(ProvinceCommand request, CancellationToken cancellationToken)
        {
            return await pSer.GetProvince();
        }
    }
}
